<template>
  <!-- 详情 -->
  <el-dialog title="驾驶员信息详情" :visible.sync="dialogVisible" width="50%" append-to-body
             :close-on-click-modal="false" :before-close="closedialog">
    <el-descriptions :column="2" border>
      <el-descriptions-item>
        <template slot="label">
          姓名
        </template>
        {{ form.name }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          手机号
        </template>
        {{ form.phone }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          准驾车型
        </template>
        <dict-tag :options="dict.type.quasi_driving_type" :value="form.permittedVehicleTypeName"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          道路运输从业资格证号
        </template>
        {{ form.roadTransportQualificationCertificateNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          从业资格证开始时间
        </template>
        {{ form.roadTransportQualificationCertificateStartTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          从业资格证结束时间
        </template>
        {{ form.roadTransportQualificationCertificateEndTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          驾照有效期开始时间
        </template>
        {{ form.driverLicenseStartTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          驾照有效期结束时间
        </template>
        {{ form.driverLicenseEndTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          身份证号
        </template>
        {{ form.idCardNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          身份证有效期开始时间
        </template>
        {{ form.idCardStartTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          身份证有效期结束时间
        </template>
        {{ form.idCardEndTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          驾照号
        </template>
        {{ form.driverLicenseNum }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          驾照正页
        </template>
<!--        <img src="{{ form.driverLicenseUrl }}" >-->
        <el-image :src="form.driverLicenseUrl"/>
<!--        <imageUpload v-model.trim="form.certificateBehind" :limit="1"/>-->
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          驾照副页
        </template>
<!--        {{ form.driverLicenseCopyUrl }}-->
        <el-image :src="form.driverLicenseCopyUrl"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          道路运输从业资格证照片
        </template>
        {{ form.roadTransportQualificationCertificateUrl }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          审核时间
        </template>
        {{ form.checkTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          审核人
        </template>
        {{ form.checkUserId }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          审核备注
        </template>
        {{ form.checkRemark }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          身份证正面
        </template>
<!--        {{ form.certificateFront }}-->
        <el-image :src="form.certificateFront"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          身份证背面
        </template>
<!--        {{ form.certificateBehind }}-->
        <el-image :src="form.certificateBehind"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          关联企业
        </template>
        {{ form.enterpriseId }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          同步状态
        </template>
        <dict-tag :options="dict.type.sync_status" :value="form.syncStatus"/>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          同步人
        </template>
        {{ form.syncBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          同步时间
        </template>
        {{ form.syncTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          创建人
        </template>
        {{ form.createBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          创建时间
        </template>
        {{ form.createTime }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          更新人
        </template>
        {{ form.updateBy }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          更新时间
        </template>
        {{ form.updateTime }}
      </el-descriptions-item>
    </el-descriptions>
    <div slot="footer" class="dialog-footer" style="text-align: center;">
      <el-button @click="closedialog">关闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import {getYjDriverInfo} from "@/api/miniapp/yjDriverInfo";

export default {
  props: {
    dict: {}
  },
  data() {
    return {
      //显示详情
      dialogVisible: false,
      form: {
        id: null,
        name: null,
        phone: null,
        permittedVehicleTypeName: null,
        roadTransportQualificationCertificateNum: null,
        roadTransportQualificationCertificateStartTime: null,
        roadTransportQualificationCertificateEndTime: null,
        driverLicenseStartTime: null,
        driverLicenseEndTime: null,
        idCardNum: null,
        idCardStartTime: null,
        idCardEndTime: null,
        driverLicenseNum: null,
        driverLicenseUrl: null,
        driverLicenseCopyUrl: null,
        roadTransportQualificationCertificateUrl: null,
        checkTime: null,
        checkUserId: null,
        checkRemark: null,
        certificateFront: null,
        certificateBehind: null,
        enterpriseId: null,
        syncStatus: null,
        syncBy: null,
        syncTime: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      }
    }
  },
  methods: {
    open(row) {
      this.dialogVisible = true;
      this.loadDetail(row);
    },
    closedialog() {
      this.dialogVisible = false
    },
    // 获取详情
    loadDetail(row) {
      getYjDriverInfo(row.id).then((res) => {
        if (res.code == 200) {
          this.form = res.data;
        }
      });
    },
  }
};
</script>

<style>

</style>
